<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '.' . PATH_SEPARATOR . './libs/');
require_once('./libs/Smarty/Smarty.class.php');
require_once('./libs/classes/userTable.class.php');
require_once('./libs/classes/dbconection.class.php');
dbconection::makealink();
$userbiao = new user();
foreach($_POST as $k=>$a)
{
	$a = addslashes($a);
	$_POST[$k] = htmlspecialchars($a);
}
$arow = array('user_login' => $_POST['username'],
						'user_pass' => md5($_POST['password']),
						'user_name' => $_POST['nicheng'],
						'user_sex' => $_POST['sex'],
						'user_email' => $_POST['email'],
						'user_age' => $_POST['age'],
						'user_info' => $_POST['userinfo'],
						'user_qq' => $_POST['qq'],
						'user_ip' => $_SERVER['REMOTE_ADDR']);
$ls = new Smarty();
if($userbiao->insert($arow))
{
$ls->assign('user',$_POST['username']);
$ls->display('regok.html');
}else
{
	echo "Error";
}
?>